#include "tcpserver.hpp"
#include <memory>

void Usage(char *proc)
{
    cout << "Usage:\n\t";
    cout << proc << " port" << endl;
}

int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        Usage(argv[0]);
        exit(USAGE_ERR);
    }

    uint16_t port = stoi(argv[1]);//端口号

    unique_ptr<tcpserver> server(new tcpserver(port));
    server->init();
    server->start();

    return 0;
}